-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: add print statement in to_latex example #27798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
changed `df.to_latex` to `print(df.to_latex)` closes #27789
replaced old example with new updated example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Added a small comment
pandas/core/generic.py
Outdated
\\\\\n\\midrule\n Raphael & red & sai \\\\\n Donatello & | ||
purple & bo staff \\\\\n\\bottomrule\n\\end{tabular}\n' | ||
>>> print(df.to_latex(index=False)) # doctest: +NORMALIZE_WHITESPACE | ||
'\begin{tabular}{lll} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the single quote (the first character) should also be removed (isn't showed by python when printing)
pandas/core/generic.py
Outdated
\bottomrule | ||
\end{tabular} | ||
|
||
' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and the same here
@jorisvandenbossche Done! |
pandas/core/generic.py
Outdated
name & mask & weapon \\ | ||
\midrule | ||
Raphael & red & sai \\ | ||
Donatello & purple & bo staff \\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me the &
are aligned in the output, like
In [14]: print(df.to_latex(index=False))
\begin{tabular}{lll}
\toprule
name & mask & weapon \\
\midrule
Raphael & red & sai \\
Donatello & purple & bo staff \\
\bottomrule
\end{tabular}
pandas/core/generic.py
Outdated
Donatello & purple & bo staff \\ | ||
\bottomrule | ||
\end{tabular} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and a very small detail: can you remove this trailing white line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept it because it looked like it was there in the output when I tried it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But removed now
@jorisvandenbossche I am not able to understand what is causing the test failure. Can you help me out |
@sameshl that seems as an unrelated failure that you can ignore (I need to check if there is already an issue about this failure, it might be a flaky test) |
@sameshl Thanks a lot! |
changed
df.to_latex
toprint(df.to_latex)
closes #27789